package com.meitianhui.convenitenbuy.module.wallet.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/11/15.
 */

public class CouponBean implements Parcelable {
    /**
     * doc_url : {}
     * list : []
     */
    private Map<String, String> doc_url;

    private List<DiscountCard> list;

    public Map<String, String> getDoc_url() {
        return doc_url;
    }

    public void setDoc_url(Map<String, String> doc_url) {
        this.doc_url = doc_url;
    }

    public List<DiscountCard> getList() {
        return list;
    }

    public void setList(List<DiscountCard> list) {
        this.list = list;
    }

    public static class DiscountCard implements Parcelable {

        public DiscountCard(String title) {
            this.title = title;
        }

        /**
         * created_date :
         * expired_date : 2016-12-18 19:03:22
         * item_id : 5132fb2b80a94daea79c8f732e795dda
         * neighbor_pic_path : 395dda888af146d2a89c50ee51a90d0d
         * remark :
         * sku_code : 4584348810249769
         * sku_id : a4ecfd4d0e38457b8eb29f193d8889b2
         * status : activated
         * stores_name : 凌楠测试店
         * title : 0.01元现金购买
         */
        private String category_id;
        private String created_date;
        private String expired_date;
        private String item_id;
        private String neighbor_pic_path;

        private String logo_pic_path;
        private String remark;
        private String sku_code;
        private String sku_id;
        private String status;
        private String stores_name;
        private String title;

        public String getCategory_id() {
            return category_id;
        }

        public void setCategory_id(String category_id) {
            this.category_id = category_id;
        }

        public String getCreated_date() {
            return created_date;
        }

        public void setCreated_date(String created_date) {
            this.created_date = created_date;
        }

        public String getExpired_date() {
            return expired_date;
        }

        public void setExpired_date(String expired_date) {
            this.expired_date = expired_date;
        }

        public String getItem_id() {
            return item_id;
        }

        public void setItem_id(String item_id) {
            this.item_id = item_id;
        }

        public String getNeighbor_pic_path() {
            return neighbor_pic_path;
        }

        public void setNeighbor_pic_path(String neighbor_pic_path) {
            this.neighbor_pic_path = neighbor_pic_path;
        }

        public String getLogo_pic_path() {
            return logo_pic_path;
        }

        public void setLogo_pic_path(String logo_pic_path) {
            this.logo_pic_path = logo_pic_path;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }

        public String getSku_code() {
            return sku_code;
        }

        public void setSku_code(String sku_code) {
            this.sku_code = sku_code;
        }

        public String getSku_id() {
            return sku_id;
        }

        public void setSku_id(String sku_id) {
            this.sku_id = sku_id;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getStores_name() {
            return stores_name;
        }

        public void setStores_name(String stores_name) {
            this.stores_name = stores_name;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.category_id);
            dest.writeString(this.created_date);
            dest.writeString(this.expired_date);
            dest.writeString(this.item_id);
            dest.writeString(this.neighbor_pic_path);
            dest.writeString(this.logo_pic_path);
            dest.writeString(this.remark);
            dest.writeString(this.sku_code);
            dest.writeString(this.sku_id);
            dest.writeString(this.status);
            dest.writeString(this.stores_name);
            dest.writeString(this.title);
        }

        protected DiscountCard(Parcel in) {
            this.category_id = in.readString();
            this.created_date = in.readString();
            this.expired_date = in.readString();
            this.item_id = in.readString();
            this.neighbor_pic_path = in.readString();
            this.logo_pic_path = in.readString();
            this.remark = in.readString();
            this.sku_code = in.readString();
            this.sku_id = in.readString();
            this.status = in.readString();
            this.stores_name = in.readString();
            this.title = in.readString();
        }

        public static final Creator<DiscountCard> CREATOR = new Creator<DiscountCard>() {
            @Override
            public DiscountCard createFromParcel(Parcel source) {
                return new DiscountCard(source);
            }

            @Override
            public DiscountCard[] newArray(int size) {
                return new DiscountCard[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.doc_url.size());
        for (Map.Entry<String, String> entry : this.doc_url.entrySet()) {
            dest.writeString(entry.getKey());
            dest.writeString(entry.getValue());
        }
        dest.writeTypedList(this.list);
    }

    public CouponBean() {
    }

    protected CouponBean(Parcel in) {
        int doc_urlSize = in.readInt();
        this.doc_url = new HashMap<String, String>(doc_urlSize);
        for (int i = 0; i < doc_urlSize; i++) {
            String key = in.readString();
            String value = in.readString();
            this.doc_url.put(key, value);
        }
        this.list = in.createTypedArrayList(DiscountCard.CREATOR);
    }

    public static final Creator<CouponBean> CREATOR = new Creator<CouponBean>() {
        @Override
        public CouponBean createFromParcel(Parcel source) {
            return new CouponBean(source);
        }

        @Override
        public CouponBean[] newArray(int size) {
            return new CouponBean[size];
        }
    };
}
